|
|
|
|
|
|
|
Common Properties of the ImageCombo Control |
|
|
|
|
|
|
|
|
The ImageCombo control has few properties other than the standard ones that are worth mentioning. Table 30.7 lists those properties youll likely be setting for the ImageCombo control. |
|
|
|
|
| Table 30.7 Common Properties of the ImageCombo Control. | | Property | Description | | ImageList | Set this property to the name of a valid ImageList control on the same form as the ImageCombo control. Unlike with the toolbar control, you can add to the ImageList control thats tied to this control. Because everything is created at runtime, theres no problem with adding other items. | | ComboItems | This runtime property exposes the collection of ComboItem objects to you. Each item in the list is a ComboItem object. You might use this property to loop through the collection and perform some action against each item in the list. | | SelectedItem | This property returns the currently selected ComboItem object to you. |
|
|
|
|
|
|
Loading the ComboItems Collection |
|
|
|
|
|
|
|
|
To load the ImageCombo control, you use the Add method of the ComboItems collection. When you add a top-level item, you dont specify an indentation level; for all other items, though, you will specify an indentation level. Heres an example: |
|
|
|
 |
|
|
|
|
Private Sub ComboLoad()
With icboItems
' Load Computer Items
.ComboItems.Add , "Computer", _
"Computer Items", _
"PC"
.ComboItems.Add , "DiskDrive", _
"Disk Drives", _
"DiskDrive", _
, 3
.ComboItems.Add , "FloppyDrive", _
"Floppy Drives", _ |
|
|
|
|
|